home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / doc / vim_dos.txt < prev    next >
Text File  |  1996-06-16  |  12KB  |  241 lines

  1. *vim_dos.txt*   For Vim version 4.2.  Last modification: 1996 June 13
  2.  
  3. This file contains the particularities for the MS-DOS version of Vim.
  4.  
  5. There are Three versions of Vim that can be used with MS-DOS machines:
  6.  
  7. 16-bit version    Can be used on any MS-DOS system, only uses up to
  8.         640 Kbyte of memory.  Also runs on OS/2, Windows 95, and NT.
  9. 32-bit version  Requires 386 processor and a DPMI driver, uses all
  10.         available memory.  Supports long file names where available.
  11. Win32 version   Requires Windows 95 or Windows NT, uses all available
  12.         memory, supports long file names, etc.  See |vim_w32.txt|
  13.  
  14. It is recommended to use the 32-bit or Win32 version.  Although the 16-bit
  15. version is able to edit very big files, it quickly runs out of memory when
  16. making big changes.  Disabling undo helps: ":set ul=-1".  The screen updating
  17. of the 16-bit version is the fastest of the three on DOS or Windows 95; on
  18. Windows NT, the Win32 version is just as fast.
  19.  
  20. For the 32-bit version, you may need a DPMI driver when running in MS-DOS.  If
  21. you are running Windows or installed a clever memory manager, it will probably
  22. run already.  If you get the message "No DPMI", you need to install a DPMI
  23. driver.  Such a driver is included with the executable.  The latest version of
  24. "CWSDPMI.ZIP" can be obtained from: "ftp.neosoft.com:pub/users/s/sandmann".
  25.  
  26. Known problems:
  27. - When using smartdrive (MS-DOS 6.x) with write-behind caching, it is possible
  28.   that Vim will try to create a swap file on a read-only file system (e.g.
  29.   write protected floppy).  You will then be given the message
  30.     "A serious disk error has occurred .., Retry (r)? " There is nothing
  31.   you can do but unprotect the floppy or switch off the computer.  Even
  32.   CTRL-ALT-DEL will not get you out of this.  This is really a problem of
  33.   smartdrive, not Vim.  Smartdrive works fine otherwise.  If this bothers you,
  34.   don't use the write-behind caching.
  35. - The 16 bits MS-DOS version can only have about 10 files open (in a window or
  36.   hidden) at one time.  With more files you will get error messages when
  37.   trying to read or write a file, and for filter commands.
  38. - The 32 bits MS-DOS version runs out of file descriptors when using a command
  39.   like ":r!ls"; Vim crashes after about five to twelve tries.
  40.  
  41. Using backslashes in file names can be a problem.  Vi halves the number of
  42. backslashes for some commands.  Vim is a bit more tolerant and backslashes
  43. are not removed from a file name, so ":e c:\foo\bar" works as expected.  But
  44. when a backslash is used before a special character (space, comma, backslash,
  45. etc.), it is removed.  Use slashes to avoid problems: ":e c:/foo/bar" works
  46. fine.  Vim will replace the slashes with backslashes internally, to avoid
  47. problems with some MS-DOS programs.
  48.  
  49. The default output method for the screen is to use bios calls.  This will work
  50. right away on most systems.  You do not need ansi.sys.  You can use ":mode" to
  51. set the current screen mode.  See vim_ref.txt, section 20.3 |:mode|.
  52.  
  53. You can set the color used in five modes with nine termcap options.  Which of
  54. the five modes is used for which action depends on the 'highlight' ('hl')
  55. option.  See vim_ref.txt |'highlight'|.
  56.  
  57.     ":set t_mr=^V^[\|xxm"        start of invert mode
  58.     ":set t_md=^V^[\|xxm"        start of bold mode
  59.     ":set t_me=^V^[\|xxm"        back to normal text
  60.  
  61.     ":set t_so=^V^[\|xxm"        start of standout mode
  62.     ":set t_se=^V^[\|xxm"        back to normal text
  63.  
  64.     ":set t_us=^V^[\|xxm"        start of underline mode
  65.     ":set t_ue=^V^[\|xxm"        back to normal text
  66.  
  67.     ":set t_ZH=^V^[\|xxm"        start of italics mode
  68.     ":set t_ZR=^V^[\|xxm"        back to normal text
  69.  
  70. ^V is CTRL-V
  71. ^[ is <Esc>
  72. xx must be replaced with a decimal code: The foreground color number and
  73.    background color number added together:
  74.  
  75. COLOR        FOREGROUND    BACKGROUND
  76. black            0            0
  77. blue            1           16
  78. green            2           32
  79. cyan            3           48
  80. red            4           64
  81. magenta            5           80
  82. brown            6           96
  83. lighgray        7          112
  84. darkgray        8
  85. lightblue        9
  86. lightgreen       10
  87. lighcyan       11
  88. lightred       12
  89. lighmagenta       13
  90. yellow           14
  91. white           15
  92. blink               128
  93.  
  94. When you use 0, the color is reset to the one used when you started Vim.  This
  95. is the default for t_me.  The default for t_mr is black on grey, 0 + 112 = 112.
  96. The default for t_md is white on cyan, 15 + 48 = 63.  The default for t_so is
  97. white on blue, 15 + 16 = 31.  These colors were chosen, because they also look
  98. good when using an inverted display.  But you can change them as you like.
  99.  
  100. The termcap codes that are translated into bios calls are:
  101.     t_cl    <Esc>|J            clear screen
  102.     t_ce    <Esc>|K            clear to end of line
  103.     t_al    <Esc>|L            insert line
  104.     t_dl    <Esc>|M            delete line
  105.     t_cm    <Esc>|{row};{col}H    position cursor
  106.     t_cs    <Esc>|{row};{row}r    set scrolling region
  107.     t_..    <Esc>|attrm        set character attribute
  108.  
  109. If you set these with the ":set" command, don't forget to put a backslash
  110. before the '|', otherwise it will be recognized as the end of the command.
  111.  
  112. If you want to use another output method (e.g., when using a terminal on a COM
  113. port), set the terminal name to "pcansi".  You can change the termcap options
  114. when needed (see chapter 20 of vim_ref.txt |terminal_options|).  Note that the
  115. normal IBM ansi.sys does not support all the codes of the builtin pcansi
  116. terminal.  If you use ansi.sys, you will need to delete the termcap entries
  117. t_al and t_dl with
  118.     ":set t_al= t_dl=".
  119. Otherwise, the screen will not be updated correctly.  It is better to use
  120. nansi.sys, nnansi.sys, or the like instead of ansi.sys.
  121.  
  122. If you want to use Vim on a terminal connected to a COM: port, reset the
  123. 'bioskey' option.  Otherwise the commands will be read from the PC keyboard.
  124. CTRL-C and CTRL-P may not work correctly with 'bioskey' reset.
  125.  
  126. If the "tx" (textmode) option is set (which is the default), Vim will accept
  127. a single <NL> or a <CR><NL> pair for end-of-line.  When writing a file, Vim
  128. will use <CR><NL>.  Thus, if you edit a file and write it, <NL> is replaced
  129. with <CR><NL>.  If the "tx" option is not set, the single <NL> will be used
  130. for end-of-line.  A <CR> will be shown as ^M.  You can use Vim to replace
  131. <NL> with <CR><NL> by reading in any mode and writing in text mode (":se
  132. tx").  You can use Vim to replace <CR><NL> with <NL> by reading in text mode
  133. and writing in non-text mode (":se notx"). 'textmode' is set automatically
  134. when 'textauto' is on (which is the default), so you don't really have to
  135. worry about what you are doing.
  136.                         |'textmode'| |'textauto'|
  137.  
  138. If you want to edit a script file or a binary file, you should reset the
  139. 'textmode' and 'textauto' options before loading the file.  Script files and
  140. binary files may contain single <NL> characters which would be replaced with
  141. <CR><NL>.  You can reset 'textmode' and 'textauto' automatically by starting
  142. Vim with the "-b" (binary) option.
  143.  
  144. You should set the environment variable "VIM" to the directory where the Vim
  145. documentation files are.  If "VIM" is used but not defined, "HOME" is tried
  146. too.
  147.  
  148. If the HOME environment variable is not set, the value "C:/" is used as a
  149. default.
  150.  
  151. The default help filename is "$VIM\vim_help.txt".  If the environment variable
  152. $VIM is not defined or the file is not found, the DOS search path is used to
  153. search for the file "vim_help.txt".  If you do not want to put "vim_help.txt"
  154. in your search path, use the command ":set helpfile=pathname" to tell Vim
  155. where the help file is.                |'helpfile'|
  156.  
  157. Vim will look for initializations in eight places.  The first that is found
  158. is used and the others are ignored.  The order is
  159.     -  The environment variable VIMINIT
  160.     -  The file "$VIM/_vimrc"
  161.     -  The file "$HOME/_vimrc"
  162.     -  The file "$VIM/.vimrc"
  163.     -  The file "$HOME/.vimrc"
  164.     -  The environment variable EXINIT
  165.     -  The file "$VIM/_exrc"
  166.     -  The file "$HOME/_exrc"
  167.  
  168. The ":cd" command recognizes the drive specifier and changes the current
  169. drive.  Use ":cd c:" to make drive C the active drive.  Use ":cd d:\dos" to go
  170. to the directory "dos" in the root of drive D.    |:cd|
  171.  
  172. Use CTRL-break instead of CTRL-C to interrupt searches.  The CTRL-C is not
  173. detected until a key is read.
  174.  
  175. Use CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and
  176. SHIFT-arrow-right.  The arrow-up and arrow-down cannot be used with SHIFT or
  177. CTRL.
  178.  
  179. Temporary files (for filtering) are put in the current directory.
  180.  
  181. The default for the sh (shell) option is "command".  If COMSPEC is defined it
  182. is used instead.  External commands are started with "command /c
  183. <command_name>".  Typing CTRL-Z starts a new command shell.  Return to Vim with
  184. "exit".
  185.  
  186. MS-DOS allows for only one filename extension.  Therefore, when appending an
  187. extension, the '.' in the original filename is replaced with a '_', the name
  188. is truncated to 8 characters, and the new extension (e.g., ".swp") is
  189. appended.  Two examples: "test.c" becomes "test_c.bak", "thisisat.est"
  190. becomes "thisisat.bak".  To reduce these problems, the default for
  191. 'backupext' is "~" instead of ".bak".  The backup file for "thisisat.est"
  192. then becomes "thisisat.es~".  The 'shortname' option is not available,
  193. because it would always be set.
  194.  
  195. If the 32-bit DOS version is run on Windows 95 or Windows NT, it can use long
  196. filenames, as can the Win32 version.
  197.  
  198. The MS-DOS binary was compiled with Borland-C++ version 4.0, using
  199. makefile.bcc.  Other compilers should also work.  Use makefile.dos for
  200. Turbo-C 2.0.  Use makefile.bcc for other Borland compilers, also Turbo-C++
  201. 3.0 (with small changes).  If you get all kinds of strange error messages
  202. when compiling, try adding <CR> characters at the end of each line.  This can
  203. be done with the addcr program: "make addcr".  This will compile addcr.c to
  204. addcr.exe and then execute the addcr.bat file.  Sometimes this fails.  In
  205. that case, execute the addcr.bat file from the DOS prompt.
  206.  
  207.  
  208. The "spawno" library by Ralf Brown was used in order to free memory when Vim
  209. starts a shell or other external command.  Only about 200 bytes are taken from
  210. conventional memory.  When recompiling get the spawno library from Simtel,
  211. directory "msdos/c".  It is called something like "spwno413.zip".  Or remove
  212. the library from the makefile.
  213.  
  214. A swap file is used to store most of the text.  You should be able to edit
  215. very large files.  However, memory is used for undo and other things.  If you
  216. delete a lot of text, you can still run out of memory in the 16-bit version.
  217.  
  218. In the 16-bit version the line length is limited to about 32000 characters.
  219. When reading a file the lines are automatically split.  But editing a line
  220. in such a way that it becomes too long may give unexpected results.
  221.  
  222. If Vim gives an "Out of memory" warning, you should stop editing.  The result
  223. of further editing actions is unpredictable.  Setting 'undolevels' to 0 saves
  224. some memory.  Running the maze macros on a big maze is guaranteed to run out
  225. of memory, because each change is remembered for undo.  In this case set
  226. 'undolevels' to a negative number.  This will switch off undo completely.
  227.  
  228. In the 32-bit version, extended memory is used to avoid these problems.
  229.  
  230. About using Vim to edit a symbolically linked file on a Unix NFS file server:
  231. When writing the file, Vim does not "write through" the symlink.  Instead, it
  232. deletes the symbolic link and creates a new file in its place.
  233.    On Unix, Vim is prepared for links (symbolic or hard).  A backup copy of
  234. the original file is made and then the original file is overwritten.  This
  235. assures that all properties of the file remain the same.  On non-Unix systems,
  236. the original file is renamed and a new file is written.  Only the protection
  237. bits are set like the original file.  However, this doesn't work properly when
  238. working on an NFS-mounted file system where links and other things exist.  The
  239. only way to fix this in the current version is not making a backup file, by
  240. ":set nobackup nowritebackup"    |'writebackup'|
  241.